<%@Page Language="VB"%>
<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.SqlClient" %>
<html><head>
<title>
Repeater Control</title>
</head>
<body>
<span class="heading">
	RadioButtonList and ADO.NET Objects
</span>
<hr width="350" align="left"/>
<div id="outError" runat="server">&nbsp;</div>
<form runat=server>
<b>&lt;ASP:RadioButtonList&gt;</b> control:<br />
<ASP:RadioButtonList id="MyRadioList" runat="server" /><br />
</form>

<script language="vb" runat="server">
Sub Page_Load(ByVal sender As Object, _
ByVal e As EventArgs)      
   Dim myDataSet As New DataSet()
   Try
      Dim strConn As String
      Dim strSQL As String
      strConn= _
      ConfigurationSettings.appSettings("conn")
      Dim myConn As New SqlConnection(strConn)      
      strSQL = "SELECT * From "
      strSQL +=" tblUsers"
      Dim myDataAdapter As New _
	SqlDataAdapter(strSQL, myConn)
      myDataAdapter.Fill(myDataSet,  _
	strSQL)     
   Catch objError As Exception
      	outError.innerHTML = _
	"<b>* Error while " & _
	"accessing data</b>.<br />" _
          	& objError.Message & "<br />" & _
	objError.Source
      Exit Sub  
   End Try        
   MyRadioList.DataSource = myDataSet
   MyRadioList.DataValueField = "UserID"
   MyRadioList.DataTextField = "UserName"
   Page.DataBind()
End Sub
</script>
</body>
</html>
  